package com.zzp.thread;

public class TestPriority {

    public static void main(String[] args) {
        System.out.println(Thread.currentThread().getName()  + "主线程优先级为："+Thread.currentThread().getPriority());

        Thread t1 = new Thread(new MyThread());
        t1.setPriority(1);
        t1.start();


        Thread t2 = new Thread(new MyThread());
        t2.setPriority(3);
        t2.start();

        Thread t3 = new Thread(new MyThread());
        t3.setPriority(6);
        t3.start();

        Thread t4 = new Thread(new MyThread());
        t4.setPriority(10);
        t4.start();
    }

}

class MyThread implements Runnable{
    public void run(){
        System.out.println(Thread.currentThread().getName() + "线程优先级为："+Thread.currentThread().getPriority());
    }
}
